home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / image / fixtx608.zip / FIXTEXT.DOC < prev    next >
Text File  |  1996-07-19  |  14KB  |  295 lines

  1. FIXTEXT.DOC                          1                         Revised: 07-19-96
  2.  
  3. The FIXTEXT.EXE program applies a character-translation template to  any  entire
  4. text file.  This allows you to change a  whole  bunch  of  characters  at  once.
  5. Features:
  6.  
  7.   * Can process text files of any size.
  8.   * Can process DOS text files (lines ending with CR/LF), Mac text files
  9.     (lines ending with CR), Unix text files (lines ending with LF), and fixed
  10.     length files (lines of a fixed length without any CR or LF characters).
  11.   * Can convert any of the above four types of text files to any of the
  12.     other types of text files.
  13.   * Automatically detects the type of input file if it's a standard text
  14.     file (lines ending with CR/LF, CR alone, or LF alone).
  15.   * Ideal utility to convert all Unix text files to DOS text files.
  16.   * Can be used on binary files but using the /REPLACE option isn't exactly
  17.     recommended in this case...
  18.   * Can load a user-defined character-translation tables.
  19.   * Character-translation tables can let you do things like:
  20.       - Convert all lowercase characters to uppercase characters
  21.       - Translate IBM graphics characters into standard ASCII text characters;
  22.         this is very useful if you want to print the document and are tired of
  23.         getting weird stuff printing out.
  24.   * Can translate tab characters into spaces.
  25.   * Can fix up underscores and other backspace characters.
  26.   * Can remove trailing spaces from lines.
  27.   * Can create a file showing all lines that were changed.
  28.   * Can translate single characters into multiple characters or remove them
  29.     entirely.
  30.   * The input file specification can include standard DOS wildcards or an
  31.     external file (@listfile) containing the files to be processed (although
  32.     either prohibits specifying an output file name).
  33.  
  34.  
  35. Specifying parameters:
  36.  
  37. Parameters for this program can be set in the following ways.  The last  setting
  38. encountered always wins:
  39.   - Read from an *.INI file (see BRUCEINI.DOC file),
  40.   - Through the use of an environmental variable (SET FIXTEXT=whatever), or
  41.   - From the command line (see "Syntax" below)
  42.  
  43.  
  44.  
  45. FIXTEXT.DOC                          2                         Revised: 07-19-96
  46.  
  47. The character translation file (lookup tables):
  48.  
  49. FIXTEXT will process a character-translation (lookup) table  if  one  is  found.
  50. This table can be in your standard *.INI file (e.g. FIXTEXT.INI) if  desired  or
  51. it can be a separate file specified using the /Linitfile parameter.
  52.  
  53. A sample FIXTEXT.INI file is provided.  You can modify this file or create  your
  54. own.
  55.  
  56. If no *.INI file is found (or if "/-I" or "/INULL" is  specified),  the  default
  57. translation table will be  loaded.   This  one  is  identical  to  the  original
  58. FIXTEXT.INI file and has these characteristics:
  59.  
  60.   - All characters in the decimal 032 to 125 range are left unchanged
  61.   - Characters in decimal 24 to 27, and 176 to 223 are considered graphics
  62.     characters and are translated into regular text characters, typically
  63.     ".", "X", "x", "|", "-", and "+"
  64.   - Decimal characters 248 to 250 and 254 are changed into asterisks ("*")
  65.   - All other characters are translated into spaces
  66.  
  67. As an example of the graphics character translation that's done, the following:
  68.  
  69.          ┌─┬─┐   ╔═╦═╗                      +-+-+   +-+-+
  70.          │ │ │   ║ ║ ║                      | | |   | | |
  71.          ├─┼─┤   ╠═╬═╣        becomes:      +-+-+   +-+-+
  72.          │ │ │   ║ ║ ║                      | | |   | | |
  73.          └─┴─┘   ╚═╩═╝                      +-+-+   +-+-+
  74.  
  75. It may not look as good but it certainly prints better on most printers.
  76.  
  77. The lookup table is an ASCII text file which consists of a series  of  lines  in
  78. the following format:
  79.  
  80.         inchar = outstr
  81.  
  82. where "inchar" is the character to change from and "outstr" is  what  to  change
  83. the character to.  Both portions can consist of  regular  non-space  ASCII  text
  84. characters (like "A" or "z") as well as hexadecimal values (in the form &Hxx) or
  85. decimal values (in the  form  \nnn).   "outstr"  can  consist  of  0  (the  word
  86. "(NONE)"), 1, or 2 or  more  replacement  characters  while  "inchar"  can  only
  87. represent a single character.  You cannot use a space or equal  sign  in  either
  88. "inchar" or "outstr"; use the hexadecimal or  decimal  representations  instead.
  89. The table does not have to be in any specified order.  Lines can end  with  "/*"
  90. followed by a comment if you want.
  91.  
  92. Hexadecimal and decimal equivalents are explained in BRUCEHEX.DOC.
  93.  
  94.  
  95. FIXTEXT.DOC                          3                         Revised: 07-19-96
  96.  
  97. Examples:
  98.  
  99.         a    = A /* Translate lowercase "a" into capital "A"
  100.         \032 = _ /* Translate space (decimal 032, &H20 too) into underscore
  101.         &H0c = <PAGE>\013\010 /* Translate page eject character into chars
  102.                               /* "<PAGE>" followed by carriage return/line feed
  103.         \027 = \032    /* Translate escape character to a space
  104.         \027 = (NONE)  /* Remove excape characters entirely
  105.  
  106. Since lines beginning with "/" are treated as command-line  defaults,  you  must
  107. use \047 or &H2F if you want to override the definition of "/".
  108.  
  109. Note that when characters are not translated into single characters, all of  the
  110. single-character  translations  are  performed  first  and  then  the  remaining
  111. translations are performed in the order they were specified.  So something  like
  112. the following would result in some lines being changed twice:
  113.  
  114.         A = CAPITAL_A
  115.         a = A
  116.  
  117. In this case, all lowercase "a" characters would first  be  translated  into  an
  118. uppercase "A", and then the same character would then  be  translated  into  the
  119. string "CAPITAL_A".
  120.  
  121.  
  122.  
  123. FIXTEXT.DOC                          4                         Revised: 07-19-96
  124.  
  125. Syntax:
  126.  
  127.     FIXTEXT { filespec | @listfile }
  128.       { outspec [ /OVERWRITE | /-OVERWRITE | /OVERASK ] | /REPLACE }
  129.       [ /n ] [ /TO CRLF | /TO CR | /TO LF | /TO n ]
  130.       [ /TEXT | /-TEXT | /BINARY ] [ /EJECT=str ] [ /Frptfile | /-F ] [ /-EOF ]
  131.       [ /MONO ] [ /Iinitfile | /-I ] [ /Linitfile | /-L ] [ /Q ] [ /? ] [ /?&H ]
  132.  
  133. "filespec" is the input file specification to process.   Can  include  path  and
  134. wildcard information if desired.
  135.  
  136. "@listfile" allows you to have a variety of file specifications saved in a  text
  137. file named "listfile".  Each line  in  the  file  should  consist  of  one  file
  138. specification, each of which can include a path and wildcards if desired.  Blank
  139. lines and lines beginning with semi-colons, colons, or quotes are ignored.
  140.  
  141. "outspec" is the name of the file to create.  It can include a  drive  and  path
  142. specification.  You have to specify either an outspec or the /REPLACE option. If
  143. your input specification includes more than one file name  (either  through  the
  144. use of wildcards or else by using the @listfile option), "outspec"  must  be  an
  145. output file path, not an individual file name.   Otherwise,  it  has  to  be  an
  146. individual file name.
  147.  
  148. "/OVERWRITE" says to overwrite the output file if it exists already.
  149.  
  150. "/-OVERWRITE" says to abort if the output file exists already.
  151.  
  152. "/OVERASK" says to prompt if  the  output  file  exists  already;  this  is  the
  153. default.
  154.  
  155. "/REPLACE" says to write the results to a temporary file  and,  if  the  program
  156. finds characters to change and runs successfully, to replace the  original  file
  157. with the fixed temporary  file.   The  original  file  is  renamed  with  a  BAK
  158. extension if you use this option.  You have to specify *either* an  output  file
  159. name or the /REPLACE option.
  160.  
  161. "/n" specifies that the input file doesn't have any carriage return or line feed
  162. indicators at all and that, in fact, lines are all fixed  length.   The  routine
  163. automatically detects the standard text files (lines end with CR/LF,  CR  alone,
  164. or LF alone); only fixed-length input files require this parameter.
  165.  
  166. "/TO=CRLF" specifies that the output lines are to  end  with  the  standard  DOS
  167. CR/LF combination.
  168.  
  169. "/TO=CR" specifies that the output lines are to end with  the  standar